#ifndef __HEALPIX_DATA_H
#define __HEALPIX_DATA_H

#include <iostream>
#include <vector>

#include "DataContainer.h"
#define HEALPIX_NULLVAL (-1.6375e30)

using namespace std;

extern "C" {

	int ang2pix_ring(const long, double, double, long *);
}

typedef struct healpix_value {

	int pixel;
	float value[4];
	float weight[4];

} healpix_t;

class HEALPIX_Data : public DataContainer {

	private:

	int nside;
	vector<healpix_t> data;

	public:
	/* pixnum is not the HEALPIX index but the index into the current data */
	int Get_Sky_Val(float ra, float dec, vector<float>& values);
	int Get_Pix_Val(int pixnum, vector<float>& values);
	int Get_Pix_Vertices(int pixnum, vector<float>& point, vector<float>& vertices);
	void Get_Val_Limits(vector<float> &limits);
	int load();

	HEALPIX_Data(char *);
	HEALPIX_Data();
	~HEALPIX_Data();

};
#endif	
